#include "canbus/message.h"

/**
 * @namespace canbus
 * @brief canbus
 */
namespace canbus {

/**
 * @class CanMsgEncoderFL
 * @brief Concrete can message that stores part of the wheel rpm information
 */
class CanMsgEncoderFL: public CanMsg {
public:
  CanMsgEncoderFL():
  CanMsg(),
  wheel_rpm_fl(0) 
  {}

  CanMsgEncoderFL(uint8_t* value): 
  CanMsg(value),
  wheel_rpm_fl(0) 
  {}

  virtual ~CanMsgEncoderFL() = default;

  void UpUpdateData() {
    // only updateData data under specific condition
    if (*data_ == 1) {
      wheel_rpm_fl  = ParseTwins(*(data_+5), *(data_+4));
    }
  }

  template <typename T>
  void DownUpdateData(const T& input_data) {}

  static const int32_t ID;
  static const std::string NAME;

  double wheel_rpm_fl;

  friend class CanbusHandler;
};

}